﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace mediatheque.Controllers
{
    public class SearchController : Controller
    {
        private mediathequeEntities db = new mediathequeEntities();

        //
        // GET: /Search/query

        public ActionResult Index(string query)
        {
            ViewData["oeuvres"]   = db.oeuvres.Where(o => o.titre.Contains(query)).ToArray();
            ViewData["chapitres"] = db.chapitres.Where(c => c.titre.Contains(query)).ToList();
            
            return View();
        }

    }
}
